(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
and(true, X) → X
and(false, Y) → false
if(true, X, Y) → X
if(false, X, Y) → Y
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
and(true, X) → X
and(false, Y) → false
if(true, X, Y) → X
if(false, X, Y) → Y
add(0', X) → X
add(s(X), Y) → s(add(X, Y))
first(0', X) → nil
first(s(X), cons(Y, Z)) → cons(Y, first(X, Z))
from(X) → cons(X, from(s(X)))
S is empty.
Rewrite Strategy: FULL
(3) SlicingProof (LOWER BOUND(ID) transformation)
Sliced the following arguments:
cons/0
from/0
(4) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
and(true, X) → X
and(false, Y) → false
if(true, X, Y) → X
if(false, X, Y) → Y
add(0', X) → X
add(s(X), Y) → s(add(X, Y))
first(0', X) → nil
first(s(X), cons(Z)) → cons(first(X, Z))
from → cons(from)
S is empty.
Rewrite Strategy: FULL
(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(6) Obligation:
TRS:
Rules:
and(true, X) → X
and(false, Y) → false
if(true, X, Y) → X
if(false, X, Y) → Y
add(0', X) → X
add(s(X), Y) → s(add(X, Y))
first(0', X) → nil
first(s(X), cons(Z)) → cons(first(X, Z))
from → cons(from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
(7) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
add, first, from
(8) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
The following defined symbols remain to be analysed:
add, first, from
(9) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
add(
gen_0':s5_0(
n8_0),
gen_0':s5_0(
b)) →
gen_0':s5_0(
+(
n8_0,
b)), rt ∈ Ω(1 + n8
0)
Induction Base:
add(gen_0':s5_0(0), gen_0':s5_0(b)) →RΩ(1)
gen_0':s5_0(b)
Induction Step:
add(gen_0':s5_0(+(n8_0, 1)), gen_0':s5_0(b)) →RΩ(1)
s(add(gen_0':s5_0(n8_0), gen_0':s5_0(b))) →IH
s(gen_0':s5_0(+(b, c9_0)))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(10) Complex Obligation (BEST)
(11) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Lemmas:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
The following defined symbols remain to be analysed:
first, from
(12) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
first(
gen_0':s5_0(
n599_0),
gen_nil:cons6_0(
n599_0)) →
gen_nil:cons6_0(
n599_0), rt ∈ Ω(1 + n599
0)
Induction Base:
first(gen_0':s5_0(0), gen_nil:cons6_0(0)) →RΩ(1)
nil
Induction Step:
first(gen_0':s5_0(+(n599_0, 1)), gen_nil:cons6_0(+(n599_0, 1))) →RΩ(1)
cons(first(gen_0':s5_0(n599_0), gen_nil:cons6_0(n599_0))) →IH
cons(gen_nil:cons6_0(c600_0))
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(13) Complex Obligation (BEST)
(14) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Lemmas:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
first(gen_0':s5_0(n599_0), gen_nil:cons6_0(n599_0)) → gen_nil:cons6_0(n599_0), rt ∈ Ω(1 + n5990)
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
The following defined symbols remain to be analysed:
from
(15) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol from.
(16) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Lemmas:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
first(gen_0':s5_0(n599_0), gen_nil:cons6_0(n599_0)) → gen_nil:cons6_0(n599_0), rt ∈ Ω(1 + n5990)
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
(18) BOUNDS(n^1, INF)
(19) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Lemmas:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
first(gen_0':s5_0(n599_0), gen_nil:cons6_0(n599_0)) → gen_nil:cons6_0(n599_0), rt ∈ Ω(1 + n5990)
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
No more defined symbols left to analyse.
(20) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
(21) BOUNDS(n^1, INF)
(22) Obligation:
TRS:
Rules:
and(
true,
X) →
Xand(
false,
Y) →
falseif(
true,
X,
Y) →
Xif(
false,
X,
Y) →
Yadd(
0',
X) →
Xadd(
s(
X),
Y) →
s(
add(
X,
Y))
first(
0',
X) →
nilfirst(
s(
X),
cons(
Z)) →
cons(
first(
X,
Z))
from →
cons(
from)
Types:
and :: true:false → true:false → true:false
true :: true:false
false :: true:false
if :: true:false → if → if → if
add :: 0':s → 0':s → 0':s
0' :: 0':s
s :: 0':s → 0':s
first :: 0':s → nil:cons → nil:cons
nil :: nil:cons
cons :: nil:cons → nil:cons
from :: nil:cons
hole_true:false1_0 :: true:false
hole_if2_0 :: if
hole_0':s3_0 :: 0':s
hole_nil:cons4_0 :: nil:cons
gen_0':s5_0 :: Nat → 0':s
gen_nil:cons6_0 :: Nat → nil:cons
Lemmas:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
Generator Equations:
gen_0':s5_0(0) ⇔ 0'
gen_0':s5_0(+(x, 1)) ⇔ s(gen_0':s5_0(x))
gen_nil:cons6_0(0) ⇔ nil
gen_nil:cons6_0(+(x, 1)) ⇔ cons(gen_nil:cons6_0(x))
No more defined symbols left to analyse.
(23) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
add(gen_0':s5_0(n8_0), gen_0':s5_0(b)) → gen_0':s5_0(+(n8_0, b)), rt ∈ Ω(1 + n80)
(24) BOUNDS(n^1, INF)